package com.fuli.app.dto.query;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class BaseQueryDTO {
    @ApiModelProperty("页码>0")
    private Integer pageNo = 1;

    @ApiModelProperty("单页数据>0")
    private Integer pageSize = 10;

    @ApiModelProperty("起始数据（不需要填写，后台自动计算）")
    private Integer beginIndex;

    public Integer getBeginIndex() {
        if (pageNo == null || pageSize == null)
            return null;
        beginIndex = (pageNo - 1) * pageSize;
        return beginIndex;
    }
}
